The present invention relates to digital imaging.
Single point image warping techniques are currently available for image deformation. For instance, Adobe® Photoshop® provides the liquefy feature, where a user can select an arbitrary pixel and specify its displacement. Neighboring pixels are displaced so as to create a smooth displacement field that dissipates slowly as one moves further away from the selected pixel. In order to perform image feature embedding by using the liquefy feature, the user has to figure out the appropriate scale factor for size alignment and then click and drag hundreds of points to achieve the shape alignment. This procedure is extremely tedious and error prone.
Mesh warping techniques are also available where the spatial relationship between image pixels is altered based on specified input displacements at a scattered subset of these pixels. This is typically done in two steps. First, a discrete displacement field, specifying the displacement for each pixel in the input image bitmap, is estimated based on the given input displacements at the scattered set of pixels. This displacement field is created to be as smooth as possible. Typically, this is done by fitting a smooth and continuous (local or global) function to the given set of input displacements. This function is then sampled at image bitmap positions to obtain the discrete displacement field. This process is known as coordinate resampling.
Coordinate resampling provides the displacement for pixels. Next, the pixels in the output bitmap must be painted. This is known as intensity resampling. In general, the displacement field does not map input pixels to output pixels with integer coordinates. Further, the displacement field is not invertible in most cases (i.e., output pixels cannot be mapped back to input pixels using closed form equations). An output accumulator can be used to address this problem. In this approach, the system walks over the input pixels, accumulating their contributions to each output pixel. The final color at each output pixel is a distance-weighted sum of the colors of input pixels that map to the neighborhood of that output pixel.
Another option is to compute the inverse mapping (i.e., output pixel to input pixel) in the coordinate resampling stage. In this manner, the computed displacement field maps the output to input. During intensity resampling, each output pixel is mapped to some location on the input image plane. In general, this would not be a pixel position in the input bitmap. Hence, some local interpolation scheme is generally used to obtain the color for the output pixel.
However, these typical methods of mesh warping suffer from a number of drawbacks. Chief among them is that they do not enforce any global smoothness measure on the generated output color field. It is desirable to have the ability to automatically modify the shape of one or more features in the image so as to match other specified shapes, with the variation in the color field caused by the warping conforming to some global smoothness norm. Without it, the result will be less visually pleasing and discontinuities may appear at certain locations within the image, causing the image to look torn.